package com.itheima.com.redis;

import org.junit.jupiter.api.Test;
import redis.clients.jedis.Jedis;

public class redis {

    @Test
    public void testRedis(){
        //获取连接
        Jedis jedis = new Jedis("localhost", 6379);

        //执行具体操作
        jedis.set("username","xiaoming");
        String username = jedis.get("username");
        System.out.println(username);
        //jedis.del("username");

        jedis.hset("myhash","addr","nk");
        String hget = jedis.hget("myhash", "addr");
        System.out.println(hget);
        //关闭连接
        jedis.close();
    }
}
